package com.ahy231.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.ibatis.type.JdbcType;

import java.io.Serializable;
import java.sql.Date;
import java.sql.Timestamp;

/**
 * @author ahy231
 * @date 2021/7/26 9:58
 * @description
 */
@Data
@ApiModel("新闻")
public class News implements Serializable {

    private static final long serialVersionUID = 6783802265187877842L;

    @ApiModelProperty("主键")
    @TableId(type = IdType.ASSIGN_ID)
    private Long newsId;

    @ApiModelProperty("新闻名称")
    private String name;

    @ApiModelProperty("新闻内容")
    private String content;

    @ApiModelProperty("封面照片url")
    private String picture;

    @ApiModelProperty("发布时间")
    @TableField(jdbcType = JdbcType.TIMESTAMP)
    @JsonFormat(pattern = "yyyy-MM-dd HH-mm-ss", timezone = "GMT+8")
    private Timestamp time;

    @ApiModelProperty("作者")
    private String author;
}
